//
//  QDLargeButtonTableHeaderView.swift
//  QDMetroClient
//
//  Created by YueWen on 2019/2/24.
//  Copyright © 2019 YueWen. All rights reserved.
//

import UIKit

/// 模拟的大标题 并在右侧出现响应按钮
final class QDLargeButtonTableHeaderView: QDLargeTitleTableHeaderView {
    
    /// 用于设置titleLabel的text
    var buttonTitle: String = "" {
        willSet {
            button.setTitle(newValue, for: .normal)
        }
    }

    /// 响应的按钮
    let button = UIButton()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        button.adjustsImageWhenHighlighted = false
        button.titleLabel?.font = Font.regular.font(size: 14)
        button.setTitleColor(QDColors.theme, for: .normal)
        
        addSubview(button)
        
        button.snp.makeConstraints { (make) in
            make.right.equalToSuperview().inset(20)
            make.height.equalTo(20)
            make.top.equalToSuperview().offset(7)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
}
